namespace cuberga.Utils
{
    class Configuration
    {
        private const string _workflowFileName = "WFSchema.xml";
        private const string _prefix = "file:///";

        public static string WorkflowFileName
        {
            get
            {
                return ProjectBaseDir + "/" + _workflowFileName;
            }
        }

        public static string ProjectBaseDir {
            get {
                string systemPath;

                systemPath = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase;
                                
                if (systemPath.StartsWith(_prefix)) {
                    systemPath = systemPath.Remove(0, _prefix.Length);
                }
                
                // remove EXE filename and "/debug" from project config settings
                systemPath = systemPath.Substring(0, systemPath.LastIndexOf("/"));
                systemPath = systemPath.Substring(0, systemPath.LastIndexOf("/"));
                return systemPath;
            }
        }

    }
}
